home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
jam
/
jamdisk3
/
uedit
/
config!m
< prev
next >
Wrap
Text File
|
1995-03-18
|
55KB
|
1,978 lines
-----------------------------------------------------------------------------
| Config!M |
| Copyright (C) 1986-92 Rick Stiles. All rights reserved. |
-----------------------------------------------------------------------------
*************************************
N-variables used:
n0-n9 scratch numbers
n20 delay time
n21 arithmetic total
n22 #cycles in cycle counter
n23 macroNum to be run in cycle counter
Buffers used:
buf50-buf54 scratch buffers
buf37 copied columnar text
buf38 directory names
buf39 result from DOS
buf40 DOS command
buf41 swap buf
buf42 Help buf
buf43 file name
buf44 command buffer
buf45 UNDO buffer
buf46 invert buf
buf47 hilite buf
buf48 replace text
buf49 search string
*************************************
<defines:
define(N_0 ,n0)
define(N_1 ,n1)
define(N_2 ,n2)
define(N_3 ,n3)
define(N_4 ,n4)
define(N_5 ,n5)
define(N_6 ,n6)
define(N_7 ,n7)
define(N_8 ,n8)
define(N_9 ,n9)
define(DELAY_TIME ,n20)
define(SUM_TOTAL ,n21)
define(CYCLES ,n22)
define(MACRO_NUM ,n23)
define(B_0 ,buf50)
define(B_1 ,buf51)
define(B_2 ,buf52)
define(B_3 ,buf53)
define(B_4 ,buf54)
define(BSTACK_99 ,buf99) .. note buf99 isn't actually used
define(HOME_BUF ,buf0) .. note buf0 isn't actually used
define(COLUMNAR_BUF ,buf37)
define(DIR_NAMES ,buf38)
define(DOS_RESULT ,buf39)
define(DOS_CMD ,buf40)
define(SWAP_BUF ,buf41)
define(HELP_BUF ,buf42)
define(FILE_NAME ,buf43)
define(CMD_BUF ,buf44)
define(UNDO_BUF ,buf45)
define(INVERT_BUF ,buf46)
define(HILITE_BUF ,buf47)
define(REPLACE_TXT ,buf48)
define(SEARCH_STR ,buf49)
define(Eat_MouseUp_Input ,624)
>
======= MISCELLANEOUS CMDS =======
Set max number of files can load for normal editing (1-100, usually 20)
<altCtl-f1:
putMsg("Input max # documents allowed (1-100)")
if (inputNum(N_4)) setMaxFiles(N_4) >
Mark region clicked with mouse
<virtual-buttonDown:
equateLoc(curFile,atCursor,mouseLoc)
equateLoc(curFile,eInvert,atCursor)
equateLoc(curFile,sInvert,atCursor)
if (eqNum(curFile,38)) equateLoc(DIR_NAMES,eHilite,sHilite)
runKey(Eat_MouseUp_Input) .. soak mouseUp
if (is(curFile,eFile) | is(curFile,whiteSpace)) returnFalse
while (!is(curFile,whiteSpace) & !is(curFile,sFile))
moveCursor(curFile,sChar) .. find start non-white
if (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
equateLoc(curFile,sInvert,atCursor) .. sinvert = start non-white
while (!is(curFile,whiteSpace) & !is(curFile,eFile))
moveCursor(curFile,eChar) .. find end non-white
equateLoc(curFile,eInvert,atCursor) .. einvert = end non-white
if (eqNum(curFile,38)) { .. in directory buffer 38
equateLoc(curFile,sHilite,sInvert)
equateLoc(curFile,eHilite,eInvert)
equateLoc(curFile,sInvert,eInvert)
moveCursor(curFile,sHilite)
}
refreshDisplay
>
Load File or select Directory that is CTRL-clicked.
<ctl-buttonDown:
equateNum(N_9,curFile)
if (!runKey(virtual-buttonDown)) { runKey(virtual-buttonUp) return }
if (!eqNum(curFile,38)) {
if (geLoc(curFile,sInvert,eInvert)) return .. no rgn
moveCursor(curFile,sChar)
if (!is(curFile,"/") & !is(curFile,":")) {
freeBuf(B_4)
moveCursor(curFile,sInvert)
while (!eqLoc(curFile,atCursor,eInvert)) {
if (is(curFile,":")) goto label(99)
moveCursor(curFile,eChar)
}
insertRgn(B_4,sFile,DIR_NAMES,hilite)
label(99)
insertRgn(B_4,eFile,curFile,invert)
loadFile(B_4)
return
}
moveCursor(curFile,eInvert)
freeBuf(B_3)
insertRgn(B_3,eFile,curFile,invert)
runKey(virtual-7) .. add dir to DIR_NAMES
}
runKey(virtual-9) .. show dir msg
return
>
Search for B_3 dirname in DIR_NAMES. Add name to list if not there.
<virtual-7:
moveCursor(B_3,eFile)
decLoc(B_3,atCursor)
if (!is(B_3,"/") & !is(B_3,":")) insertRgn(B_3,eFile,"/",all)
if (isEmpty(DIR_NAMES)) runKey(virtual-8) .. default dir names
.. if (isEmpty(DIR_NAMES)) goto label(0)
moveCursor(DIR_NAMES,sFile)
equateLoc(DIR_NAMES,eHilite,sHilite)
label(1)
while (is(DIR_NAMES,whiteSpace)) moveCursor(DIR_NAMES,eChar)
if (is(DIR_NAMES,eFile)) goto label(0) .. add it
equateLoc(DIR_NAMES,sHilite,atCursor) .. store start
while (!is(DIR_NAMES,whiteSpace) & !is(DIR_NAMES,eFile))
moveCursor(DIR_NAMES,eChar)
equateLoc(DIR_NAMES,eHilite,atCursor) .. store end
freeBuf(B_2)
insertRgn(B_2,sFile,DIR_NAMES,hilite)
if (!stringComp(N_4,B_3,B_2,1)) goto label(1) .. try again
moveCursor(DIR_NAMES,sHilite) .. found dirname. Put cursor at start
goto label(5)
label(0) .. dirname not found. Add it
moveCursor(DIR_NAMES,eFile)
if (!isEmpty(B_3)) {
locToCol(DIR_NAMES,N_4,atCursor)
if (gtNum(N_4,60)) insertChar(DIR_NAMES,eLine)
else insertChar(DIR_NAMES,9) .. tab
}
equateLoc(DIR_NAMES,sHilite,eFile)
decLoc(DIR_NAMES,sHilite)
insertRgn(DIR_NAMES,eFile,B_3,all) .. install new dirname as curdir
equateLoc(DIR_NAMES,eHilite,eFile)
incLoc(DIR_NAMES,sHilite)
moveCursor(DIR_NAMES,sHilite)
equateNum(N_4,curFile)
label(5)
freeBuf(B_3)
if (!eqNum(N_4,38) & gotoSplit(DIR_NAMES)) gotoSplit(buf[N_4])..force refresh
runKey(virtual-9)
>
Load beginning directory names into DIR_NAMES
<virtual-8:
if (isEmpty(DIR_NAMES)) {
if (!insertFile(DIR_NAMES,eFile,"S:Directories"))
insertRgn(DIR_NAMES,eFile," DF0: DF1: DH0: S: RAM: RAD: VD0:",all)
moveCursor(DIR_NAMES,eFile)
equateLoc(DIR_NAMES,sHilite,eHilite)
equateLoc(DIR_NAMES,mouseLoc,eFile)
}
equateLoc(DIR_NAMES,sPage,sFile) >
Put up msg telling what click-loading directory now is.
<virtual-9:
freeBuf(B_3)
insertRgn(B_3,eFile,"Click-loading directory = ",all)
if (gtLoc(DIR_NAMES,eHilite,sHilite)) insertRgn(B_3,eFile,DIR_NAMES,hilite)
else insertRgn(B_3,eFile,"default",all)
putMsg(B_3)
freebuf(B_3) >
Click or drag mouse, put word/phrase into index in buffer 41. (Ctl-w to see.)
<shftAlt-buttonDown:
equateLoc(curFile,atCursor,mouseLoc)
moveCursor(curFile,eWord)
equateLoc(curFile,eInvert,atCursor)
moveCursor(curFile,sWord)
equateLoc(curFile,sInvert,atCursor)
refreshDisplay >
Click or drag mouse, put word/phrase into index in buffer 41. (Ctl-w to see.)
<shftAlt-buttonUp:
equateLoc(curFile,atCursor,mouseLoc)
moveCursor(curFile,eWord)
equateLoc(curFile,eInvert,atCursor)
if (geLoc(curFile,sInvert,eInvert)) returnFalse
moveCursor(curFile,sInvert)
if (is(curFile,upperCase)) equateNum(N_0,1)
else equateNum(N_0,0)
toLower(curFile)
copyChar(curFile,N_4)
if (eqNum(N_0,1)) toUpper(curFile)
if (isEmpty(SWAP_BUF)) insertChar(SWAP_BUF,eLine)
moveCursor(SWAP_BUF,sFile)
equateLoc(SWAP_BUF,sPage,atCursor)
label(1)
if (is(SWAP_BUF,upperCase)) equateNum(N_0,1)
else equateNum(N_0,0)
toLower(SWAP_BUF)
copyChar(SWAP_BUF,N_3)
if (eqNum(N_0,1)) toUpper(SWAP_BUF)
if (gtNum(N_4,N_3)) {
moveCursor(SWAP_BUF,downLine)
if (!is(SWAP_BUF,eFile)) goto label(1)
}
insertRgn(SWAP_BUF,atCursor,curFile,invert)
insertChar(SWAP_BUF,eLine)
>
Handle DIR_NAMES directory traffic
<virtual-buttonUp:
runKey(virtual-8) .. load in dir defalts if not loaded
equateLoc(DIR_NAMES,mouseLoc,atCursor)
equateNum(N_7,0)
if (!eqNum(curFile,38) & !gotoSplit(DIR_NAMES)) {
if (!splitWindow(DIR_NAMES,7)) {
putMsg("Close a split window so can let you select Directory")
return
}
equateNum(N_7,1) .. had to make split window
}
updateDisplay
label(98)
equateLoc(DIR_NAMES,mouseLoc,sFile)
putMsg(
"Ctrl-mouse=SelectDir. F1=Edit. F2=DirList. F3=Save. F4=ChgDir. F5=CD.")
runKey(Eat_MouseUp_Input) .. soak mouseUp
getKeyVal(macroNum,inputChar)
switch(macroNum) {
case(normal-closebox)
case(normal-buttonDown) { .. done bring down window
gotoSplit(buf[N_9])
if (eqNum(N_7,1)) splitWindow(DIR_NAMES,0) .. close it if made it
runKey(virtual-9)
return
}
case(normal-f1) { .. edit DIR_NAMES
putMsg("Press left-Amiga-0 to elim split window.")
return
}
case(ctl-buttonDown) {
runkey(virtual-buttonDown)
refreshDisplay
runKey(virtual-9)
delay(3)
}
case(normal-f2) { .. get dir list
gotoSplit(buf[N_9])
if (eqNum(N_7,1)) splitWindow(DIR_NAMES,0) .. close it if made it
if (newFile) {
setFileName(curFile,"DirList")
clearRgn(curFile,all)
insertRgn(curFile,atCursor,DIR_NAMES,hilite)
insertChar(curFile,eLine)
equateLoc(curFile,sPage,sFile)
updateDisplay
freeBuf(B_4)
insertRgn(B_4,eFile,"dir ",all)
insertRgn(B_4,eFile,DIR_NAMES,hilite)
execute(curFile,B_4)
.. massage dir list
getSearch(B_0)
setSearch(" (dir)")
moveCursor(curFile,sFile)
while (search(curFile,locA,locB,1)) {
clearRgn(curFile,loc)
insertChar(curFile,"/")
moveCursor(curFile,sLine)
moveCursor(curFile,eWord)
moveCursor(curFile,sWord)
insertRgn(curFile,atCursor,DIR_NAMES,hilite)
}
setSearch(B_0) .. restore search string
moveCursor(curFile,sFile)
flipFlag(curFile,changed)
putMsg("Ctl-click dirnames to add, filenames to load.")
return
} else putMsg("Can't open file buf for dir list")
}
case(normal-f3) { saveFile(DIR_NAMES) }
case(normal-f4) { .. change dir
if (gtLoc(DIR_NAMES,eHilite,sHilite)) {
freeBuf(B_4)
insertRgn(B_4,eFile,DIR_NAMES,hilite)
changeDir(B_4)
goto label(0)
}
}
case(normal-f5) { .. get CD
label(0) freeBuf(B_3)
execute(B_3,"CD")
freeBuf(B_4)
insertRgn(B_4,eFile,"CD = ",all)
insertRgn(B_4,eFile,B_3,line)
putMsg(B_4)
delay(5)
}
}
goto label(98)
>
Scroll up 1 line
<normal-upArrow:
if (!thisKey) vScroll(-1)
else while (nothing) {
if (!vScroll(-1) | !inputWaiting) return
while (inputKey(N_4)) nothing
vScroll(-3)
updateDisplay
} >
Scroll down 1 line
<normal-downArrow:
if (!thisKey) vScroll(1)
else while (nothing) {
if (!vScroll(1) | !inputWaiting) return
while (inputKey(N_4)) nothing
vScroll(3)
updateDisplay
} >
Scroll right 1 char
<normal-leftArrow: hScroll(1) >
Scroll left 1 char
<normal-rightArrow: hScroll(-1) >
Scroll up 11 lines
<shft-upArrow: vScroll(-11) >
Scroll down 11 lines
<shft-downArrow: vScroll(11) >
Scroll right 10 chars
<shft-leftArrow: hScroll(10) >
Scroll left 10 chars
<shft-rightArrow: hScroll(-10) >
Scroll to start of page
<alt-upArrow: vScroll(sPage) >
Scroll to bottom of page
<alt-downArrow: vScroll(ePage) >
Scroll right 20 chars
<alt-leftArrow: hScroll(20) >
Scroll left 20 chars
<alt-rightArrow: hScroll(-20) >
Scroll to start of file
<ctl-upArrow: vScroll(sFile) >
Scroll to end of file
<ctl-downArrow: vScroll(eFile) >
Scroll to end of line
<ctl-leftArrow:
getLocal(curFile,N_4,lineLength)
hScroll(N_4) >
Scroll to start of line
<ctl-rightArrow: while (hScroll(-1)) nothing >
Load and show help file - press again to release help
<normal-help:
if (!isEmpty(HELP_BUF)) {
equateNum(N_4,curFile)
if (eqNum(N_4,42)) freeBuf(HELP_BUF)
else editBuf(HELP_BUF)
} else {
insertFile(HELP_BUF,sFile,"Help!")
if (isEmpty(HELP_BUF)) {
freeBuf(HELP_BUF)
insertFile(HELP_BUF,sFile,"S:Help!")
}
if (!isEmpty(HELP_BUF)) {
editBuf(HELP_BUF)
upFlag(HELP_BUF,readOnly)
} else putMsg("Can't find S:Help! file.")
} >
Start this Key-Help mode - press Amiga-ESC to leave this Key-Help mode
<ctl-help: flipFlag(curFile,teachKeys) >
Refresh screen including title bar
<shftCtl-help: fullRefresh >
Rebuild the menus by running the startup command
<shftAltCtl-Help: runKey(startup) >
Close file. If changed, ask "Save changes?" If no files, ask "Really quit?"
<normal-closeBox:
if (getFlag(curfile,changed) &
askYesNo("Save changes?") &
!saveFile(curFile)) return
freeBuf(curFile)
if (isEmpty(curFile)) {
equateNum(N_1,0)
getMaxFiles(N_0)
decNum(N_0)
do (N_4,0,N_0) if (!isEmpty(buf[N_4])) equatenum(N_1,1)
if (eqNum(N_1,0) & askYesNo("Really quit?")) quit(0)
} >
Switch to next document
<normal-gadget1: toggle(curFile) >
Switch to previous document
<normal-gadget2: runKey(shft-f1) >
Scroll display down
<normal-gadget3: while (mouseDown) { vScroll(downLine) updateDisplay } >
Scroll display up
<normal-gadget4: while (mouseDown) { vScroll(upLine) updateDisplay } >
Switch to next file
<normal-f1: toggle(curFile) >
Switch to previous file
<shft-f1:
getMaxFiles(N_3)
if (geNum(1,N_3)) { returnFalse }
decNum(N_3)
equateNum(N_4,curFile)
while (nothing) {
if (gtNum(N_4,N_3)) equateNum(N_4,N_3)
decNum(N_4)
if (gtNum(0,N_4)) equateNum(N_4,N_3)
if (getFileName(B_4,buf[N_4])) {
editBuf(buf[N_4])
returnTrue
}
} >
Load a file
<alt-f1:
putMsg("Input new filename:")
freeBuf(FILE_NAME)
if (inputString(FILE_NAME)) loadFile(FILE_NAME) >
Open new "Noname" file
<ctl-f1: newFile >
Insert file at cursor
<shftAlt-f1:
putMsg("Input filename to insert:")
freeBuf(FILE_NAME)
if (inputString(FILE_NAME)) insertFile(curFile,atCursor,FILE_NAME) >
Bring up file-requester
<lAmiga-f1:
freeBuf(B_4)
insertRgn(B_4,eFile,DIR_NAMES,hilite)
moveCursor(B_4,efile)
moveCursor(B_4,sChar)
if (!is(B_4,sfile) & is(B_4,"/")) clearChar(B_4)
if (fileRequest(B_4,"Select Directory and/or File",0)) {
freeBuf(B_3) .. if True, always has 2 lines
insertRgn(B_3,efile,B_4,all)
moveCursor(B_3,sfile)
if (!is(B_3,eline)) moveCursor(B_3,eLine)
clearChar(B_3) .. erase the eol
loadFile(B_3)
}
if (isEmpty(B_4)) {
putMsg("No selection or no Arp")
returnFalse
}
.. strip off the extra // if not using the arp requester
getSearch(B_3)
push(BSTACK_99,B_3) .. save old search string
setSearch("//")
movecursor(B_4,sFile)
.. erase one of the slashes
if (search(B_4,sInvert,eInvert,1)) clearChar(B_4)
pop(BSTACK_99,B_3) .. restore the old search string
setSearch(B_3)
moveCursor(B_4,sfile) .. puts filename on line 2. outputs "*" if no
if (!is(B_4,"*") & !is(B_4,eLine)) {
freeBuf(B_3)
insertRgn(B_3,efile,B_4,line)
runKey(virtual-7) .. store dirname in DIR_NAMES, if not already there
}
>
Save file currently in window
<normal-f2: saveFile(curFile) >
Save file under different name
<shft-f2:
putMsg("Save file as:")
freeBuf(FILE_NAME)
if (inputString(FILE_NAME) & setFileName(curFile,FILE_NAME)) saveFile(curFile) >
Save all changed files
<alt-f2:
getMaxFiles(N_3)
decNum(N_3)
do(N_4,0,N_3) if (getFlag(buf[N_4],changed)) saveFile(buf[N_4]) >
Abort the current file save
<shftAlt-f2: abortSave >
Save hilite as...
<shftCtl-f2:
freeBuf(FILE_NAME)
insertRgn(FILE_NAME,atCursor,DIR_NAMES,hilite)
putMsg("Save hilite as:")
if (!inputString(FILE_NAME)) return
freeBuf(B_4)
insertRgn(B_4,efile,curFile,hilite)
setFileName(B_4,FILE_NAME)
saveFile(B_4)
freeBuf(B_4) >
Close current file. If changed, ask "Save changes?"
<normal-f3:
if (!isEmpty(curFile)
& getFlag(curFile,changed)
& askYesNo("Save changes before closing?")
& !saveFile(curFile)) returnFalse
freeBuf(curFile) >
Save file, if changed, then close it
<shft-f3:
if (getFlag(curFile,changed) & !saveFile(curFile)) returnFalse
freeBuf(curFile) >
Free all non-file buffers. Erases search buffer, directory name, etc
<alt-f3:
getMaxFiles(N_2)
do(N_4,N_2,99) freeBuf(buf[N_4]) >
Ask "Save changes?", if any changes, then ask "Really quit?"
<normal-f4:
if (!askYesNo("Really quit?")) returnFalse
equateNum(N_3,0)
getMaxFiles(N_2)
decNum(N_2)
do(N_4,0,N_2) if (getFlag(buf[N_4],changed)) equateNum(N_3,1)
if (eqNum(N_3,1) & askYesNo("Save changes?") & !runKey(shft-f4))
returnFALSE
quit(0) >
Save all changed files automatically, then quit
<shft-f4:
getMaxFiles(N_2)
decNum(N_2)
do (N_4,0,N_2)
if (getFlag(buf[N_4],changed) & !saveFile(buf[N_4])) returnFalse
quit(0) >
Swap next 2 commands. (Mouse buttons, menu selections, gadgets, keys.)
<normal-f5:
putMsg("Next 2 function keys will be swapped!")
if (getKey(N_3) & getKey(N_4) & swapKey(N_3,N_4))
{ putMsg("Keys were swapped.") return }
putMsg("") >
Select buffer 44 to use for scratch editing or writing commands
<shft-f6:
editBuf(CMD_BUF)
putMsg("Type in command, <anykey: etc>, and press F6 to compile:") >
Save UE config to disk. Default is Data! or last name you gave
<alt-f6:
if (askYesNo("Save data?")) {
putMsg("Input data filename or pmESC:")
freeBuf(B_4)
inputString(B_4)
saveConfig(B_4)
} >
Restore UE config from disk. Default is Data! or last name you gave
<ctl-f6:
if (askYesNo("Load data?")) {
putMsg("Input data filename or pmESC:")
freeBuf(B_4)
inputString(B_4)
loadConfig(B_4)
} >
Compile configuration default values at the top of Config! file
<altCtl-f6:
moveCursor(curFile,sFile)
if (!compileDefaults(curFile)) beepDisplay>
Input the number of a buffer to edit
<shftAlt-f6:
putMsg("Input number of buffer to edit:")
if (inputNum(N_4)) { editBuf(buf[N_4]) vScroll(sFile) } >
Examine all buffers that aren't empty
<shftCtl-f6:
getMaxFiles(N_2)
do (N_4,N_2,99) if (!isEmpty(buf[N_4])) {
editBuf(buf[N_4])
vScroll(sFile)
updateDisplay
putMsg("F1=continue, F2=edit this one, F3=stop:")
getKey(N_3)
if (eqNum(N_3,normal-f2)) { putMsg("") return }
if (eqNum(N_3,normal-f3)) goto label(1)
}
label(1)
toggle(curFile)
putMsg("") >
Kill next command, including mouse button, menu selection, gadget, key
<shftAltCtl-f6:
putMsg("Next command-key will be deleted!")
if (getKey(N_4) & killKey(N_4))
{ putMsg("Key command was deleted.") return }
putMsg("") >
Find out if keys have got commands attached
<lAmiga-f6:
putMsg("Press any key")
while (getKey(N_4)) {
if (inUse(N_4)) putMsg("In use - Amiga-esc=abort")
else putMsg("Available - Amiga-esc=abort")
}>
Push current buffer onto buffer stack
<lAmiga-w: push(BSTACK_99,curFile) runKey(virtual-w) >
Pop buffer stack
<rAmiga-w:
equateNum(N_1,99) .. for buf stack 99
getStackSize(N_1,N_2,N_3)
if (geNum(0,N_1)) {
putMsg("Buffer stack is empty")
returnFalse
}
if (!askYesNo("Replace current buffer, deleting old?") & !newFile) {
putMsg("Can't open a file buffer")
returnFalse
}
pop(BSTACK_99,curFile)
runKey(virtual-w) >
Rotate buffer stack
<shftAlt-w: rollStack(BSTACK_99,1) runKey(virtual-w) >
Show number of buffers in stack
<virtual-w:
equateNum(N_1,99) .. for buffer stack 99
equateNum(N_2,99) .. and num stack 99
getStackSize(N_1,N_2,N_3)
freeBuf(B_4)
insertRgn(B_4,atCursor,"Buffers on stack: ",all)
toWord(B_4,N_1)
putMsg(B_4) >
Input search text & search fwd. (Either-Or="$", wildcards= "?" & "*".)
<normal-f7: freeBuf(SEARCH_STR) runKey(shft-f7) >
Input new search wild-card characters
<alt-f7:
putMsg("Input single wild-card char:")
getChar(wildCard)
putMsg("Input multi wild-card char:")
getChar(multiWild)
putMsg("White on single wildcards: 0=no, 1=space/tab, 2=all white:")
getChar(N_4)
if (geNum(N_4,"0") & geNum("2",N_4)) sub(singleWhite,N_4,"0")
putMsg("White on multi wildcards: 0=no, 1=space/tab, 2=all white:")
getChar(N_4)
if (geNum(N_4,"0") & geNum("2",N_4)) sub(multiWhite,N_4,"0")
putMsg("Input all-but delimiter char:")
getChar(allBut)
putMsg("")>
Input new search either-or character
<ctl-f7:
putMsg("Input new search either-or char:")
getChar(eitherOr)
putMsg("")>
Input replace text to use in search-replace
<normal-f8:
freeBuf(REPLACE_TXT)
runKey(shft-f8) >
Modify existing replace text
<shft-f8: putMsg("input replace string:") inputString(REPLACE_TXT) >
Search forward, mark matched region, put cursor at start of rgn
<normal-f9:
if (eqLoc(curFile,atCursor,eInvert)) moveCursor(curFile,sChar)
if (search(curFile,sInvert,eInvert,1)) {
putMsg("")
return
}
runKey(virtual-f9) > .. failed search msg
Search backward, mark matched region, put cursor at start of rgn
<shft-f9:
if (search(curFile,sInvert,eInvert,-1)) { putMsg("") return }
runKey(virtual-f9) > .. failed search msg
Failed search message used by fwd/bkwd search
<virtual-f9:
putMsg("Search failed.")
if (not eqLoc(curFile,sInvert,eInvert)) {
equateLoc(curFile,sInvert,eInvert)
refreshDisplay
}
returnFalse >
Replace matched region with replace text, then search forward
<normal-f10:
if (eqLoc(curFile,sInvert,eInvert)) returnFalse
clearRgn(curFile,invert)
insertRgn(curFile,sInvert,REPLACE_TXT,all)
runKey(normal-f9) >
Replace matched region with replace text, then search backward
<shft-f10:
if (eqLoc(curFile,sInvert,eInvert)) returnFalse
clearRgn(curFile,invert)
insertRgn(curFile,sInvert,REPLACE_TXT,all)
runKey(shft-f9) >
Replace and continue forward search-replace until search fails
<alt-f10: while(runKey(normal-f10)) nothing >
Open a space under cursor for typing
<shft-del:
insertChar(curFile," ") moveCursor(curFile,sChar)
if (is(curFile,sLine)) refreshDisplay>
Open line for typing below cursor line
<alt-del:
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
insertChar(curFile,eLine)>
Delete line above cursor line
<ctl-del:
equateLoc(curFile,mouseLoc,atCursor)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
if (!is(curFile,sFile)) {
moveCursor(curFile,upLine)
runKey(virtual-x) .. this runs ctl-d
moveCursor(curFile,mouseLoc)
}>
Open a space for typing in front of current word
<shft-bs:
if (!is(curFile,sWord)) moveCursor(curFile,sWord)
runKey(shft-del)>
Open line for typing above the current line
<alt-bs:
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
insertChar(curFile,eLine) moveCursor(curFile,sChar)>
Delete line below cursor line
<ctl-bs:
equateLoc(curFile,mouseLoc,atCursor)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
if (!is(curFile,eFile)) {
moveCursor(curFile,downLine)
runKey(virtual-x) .. this runs ctl-d
moveCursor(curFile,mouseLoc)
}>
*** Keypad Keys ***
Find cursor and center it in window
<normal-kp5: vScroll(atCursor) >
.. free the scratch buffer
<520:
freeBuf(UNDO_BUF)
>
Delete word left, storing it in Undo buffer
<normal-kp7:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locB,atCursor)
moveCursor(curFile,sWord)
equateLoc(curFile,locA,atCursor)
insertRgn(UNDO_BUF,sFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc) >
Delete word right, storing it in Undo buffer
<normal-kp9:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,eWord)
equateLoc(curFile,locB,atCursor)
insertRgn(UNDO_BUF,eFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc) >
Move cursor up 1 line
<normal-kp8: moveCursor(curFile,upLine) >
Move cursor down 1 line
<normal-kp2: moveCursor(curFile,downLine) >
Move cursor to start of word
<normal-kp4: moveCursor(curFile,sWord) >
Move cursor to end of word
<normal-kp6: moveCursor(curFile,eWord) >
Set start of hilite region at cursor
<normal-kp1: equateLoc(curFile,sHilite,atCursor) refreshDisplay >
Set end of hilite region at cursor
<normal-kp3: equateLoc(curFile,eHilite,atCursor) refreshDisplay >
UNDO scratch deletes, inserting scratch delete buffer at cursor
<normal-kp0: insertRgn(curFile,atCursor,UNDO_BUF,all) >
Copy hilite region into buffer
<normal-kpDot:
if (getFlag(curFile,columnar)) { runKey(shftCtl-3) return }
if (gtLoc(curFile,eHilite,sHilite)) {
freeBuf(HILITE_BUF)
insertRgn(HILITE_BUF,sFile,curFile,hilite)
equateLoc(HILITE_BUF,sPage,sFile)
} else returnFalse >
Copy hilite region into buffer, then delete hilite region
<normal-kpMinus:
if (getFlag(curFile,columnar)) { runKey(shftCtl-1) return }
if (runKey(normal-kpDot)) clearRgn(curFile,hilite)
vscroll(atcursor) >
Insert copied hilite at cursor
<normal-kpEnter:
if (getFlag(curFile,columnar)) { runKey(shftCtl-4) return }
if (is(curFile,sFile)) {
equateLoc(curFile,sHilite,atCursor)
equateLoc(curFile,eHilite,sHilite)
} else {
equateLoc(curFile,sHilite,atCursor)
decLoc(curFile,sHilite)
equateLoc(curFile,eHilite,atCursor)
}
insertRgn(curFile,atCursor,HILITE_BUF,all)
if (eqLoc(curFile,atCursor,sHilite)) equateLoc(curFile,sHilite,sFile)
else incLoc(curFile,sHilite)
if (!onScreen(atCursor)) vScroll(atCursor) >
Find cursor and center it in window
<shft-kp5: vScroll(atCursor) >
Delete char to left of cursor, storing it in Undo buffer
<shft-kp7:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locB,atCursor)
moveCursor(curFile,sChar)
equateLoc(curFile,locA,atCursor)
insertRgn(UNDO_BUF,sFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc) >
Delete char under cursor, storing it in Undo buffer
<shft-kp9:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,eChar)
equateLoc(curFile,locB,atCursor)
insertRgn(UNDO_BUF,eFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc) >
Move cursor up one line
<shft-kp8: moveCursor(curFile,upLine) >
Move cursor down one line
<shft-kp2: moveCursor(curFile,downLine) >
Move cursor left 1 char
<shft-kp4: moveCursor(curFile,sChar) >
Move cursor right 1 char
<shft-kp6: moveCursor(curFile,eChar) >
Set start of hilite region at cursor
<shft-kp1: runKey(normal-kp1) >
Set end of hilite region at cursor
<shft-kp3: runKey(normal-kp3) >
UNDO scratch deletes, inserting scratch delete buffer at cursor
<shft-kp0: runKey(normal-kp0) >
Copy hilite region into buffer
<shft-kpDot: runKey(normal-kpDot) >
Copy hilite region into buffer, then delete hilite region
<shft-kpMinus: runKey(normal-kpMinus) >
Insert copied hilite region at cursor
<shft-kpEnter: runKey(normal-kpEnter) >
Find cursor and center it in window
<alt-kp5: vScroll(atCursor) >
Delete to start of line, storing it in Undo buffer
<alt-kp7:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
if (is(curFile,sLine)) runKey(shft-kp7)
else {
equateLoc(curFile,locB,atCursor)
moveCursor(curFile,sLine)
equateLoc(curFile,locA,atCursor)
insertRgn(UNDO_BUF,sFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc)
} >
Delete to end of line, storing it in Undo buffer
<alt-kp9:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
if (is(curFile,eLine)) runKey(shft-kp9)
else {
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,eLine)
equateLoc(curFile,locB,atCursor)
insertRgn(UNDO_BUF,eFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc)
} >
Move cursor to start of page
<alt-kp8: moveCursor(curFile,sPage) vScroll(atCursor)>
Move cursor to end of page
<alt-kp2: moveCursor(curFile,ePage) >
Move cursor to start of line
<alt-kp4: moveCursor(curFile,sLine) >
Move cursor to end of line
<alt-kp6: moveCursor(curFile,eLine) >
Set start of hilite region at cursor
<alt-kp1: runKey(normal-kp1) >
Set end of hilite region at cursor
<alt-kp3: runKey(normal-kp3) >
UNDO scratch deletes, inserting scratch delete buffer at cursor
<alt-kp0: runKey(normal-kp0) >
Copy hilite region into buffer
<alt-kpDot: runKey(normal-kpDot) >
Copy hilite region into buffer, then delete hilite region
<alt-kpMinus: runKey(normal-kpMinus) >
Insert copied hilite region at cursor
<alt-kpEnter: runKey(normal-kpEnter) >
Find cursor and center it in window
<ctl-kp5: vScroll(atCursor) >
Delete from cursor to start of page, storing it in Undo buffer
<ctl-kp7:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locB,atCursor)
moveCursor(curFile,sPage)
equateLoc(curFile,locA,atCursor)
insertRgn(UNDO_BUF,sFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc)
vScroll(atCursor)
updateDisplay >
Delete from cursor to end of page, storing it in Undo buffer
<ctl-kp9:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,ePage)
equateLoc(curFile,locB,atCursor)
insertRgn(UNDO_BUF,eFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc)
updateDisplay >
Move cursor to start of form
<ctl-kp8: moveCursor(curFile,sForm) >
Move cursor to end of form
<ctl-kp2: moveCursor(curFile,eForm) >
Move cursor to start of line
<ctl-kp4: moveCursor(curFile,sLine) >
Move cursor to end of line
<ctl-kp6: moveCursor(curFile,eLine) >
Set start of invert region at cursor
<ctl-kp1: equateLoc(curFile,sInvert,atCursor) refreshDisplay >
Set end of invert region at cursor
<ctl-kp3: equateLoc(curFile,eInvert,atCursor) refreshDisplay >
UNDO scratch deletes, inserting scratch delete buffer at cursor
<ctl-kp0: runKey(normal-kp0) >
Give message telling turn OFF columnar if columnar is ON.
<virtual-kpDot:
if (getFlag(curFile,columnar)) {
alertuser("Turn OFF columnar display mode first. (See Columnar menu.)")
abort
} >
Copy invert region into buffer
<ctl-kpDot:
runKey(virtual-kpDot)
if (gtLoc(curFile,eInvert,sInvert)) {
freeBuf(INVERT_BUF)
insertRgn(INVERT_BUF,sFile,curFile,invert)
equateLoc(INVERT_BUF,sPage,sFile)
} else returnFalse >
Copy invert region into buffer, then delete invert region
<ctl-kpMinus:
runKey(virtual-kpDot)
runKey(ctl-kpDot)
clearRgn(curFile,invert) >
Insert copied invert region at cursor
<ctl-kpEnter:
runKey(virtual-kpDot)
if (is(curFile,sFile)) {
equateLoc(curFile,sInvert,atCursor)
equateLoc(curFile,eInvert,sInvert)
} else {
equateLoc(curFile,sInvert,atCursor)
decLoc(curFile,sInvert)
equateLoc(curFile,eInvert,atCursor)
}
insertRgn(curFile,atCursor,INVERT_BUF,all)
if (eqLoc(curFile,atCursor,sInvert)) equateLoc(curFile,sInvert,sFile)
else incLoc(curFile,sInvert)
if (!onScreen(atCursor)) vScroll(atCursor) >
*** miscellaneous keys ***
Set new line-length
<ctl-return:
putMsg("Enter new line-length:")
if (inputNum(N_4)) {
setLocal(curFile,lineLength,N_4)
equateNum(lineLength,N_4)
} >
Transparent tab forward
<shft-tab: moveCursor(curFile,eTab) >
Transparent tab backward
<alt-tab: moveCursor(curFile,sTab) >
Untab - delete white space back to previous tab column
<ctl-tab:
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,sTab)
while (is(curFile,space) | is(curFile,9)) {
clearChar(curFile)
if (eqLoc(curFile,atCursor,locA)) return
}>
Show tab ruler above cursor line
<shftAlt-tab: seeRuler>
Set tab ruler using mouse or keys
<shftCtl-tab:
putMsg(
"Use mouse click/drag, Tab, Space, BS, Del (anykey=quit,Amiga-ESC=abort)")
setRuler putMsg("") >
Convert tabs in document to spaces
<lAmiga-t: tabsToSpaces(curFile) >
Convert spaces in document to TABs
<rAmiga-t: spacesToTabs(curFile) >
Set TAB table number (0-4) to use for TAB spacing
<shftAltCtl-tab:
putMsg("Enter new tab table # (0-4):")
if (inputNum(N_4) & geNum(N_4,0) & geNum(4,N_4)) {
setLocal(curFile,tabTable,N_4)
equateNum(tabTable,N_4)
} >
Trim spaces between the next two words after cursor
<alt-c:
while (copyChar(curfile,N_4)
& !(eqNum(N_4,32) | eqNum(N_4,9) | is(curfile,efile)))
moveCursor(curFile,eChar)
moveCursor(curFile,eChar)
if (is(curfile,efile)) returnFalse
while (copyChar(curfile,N_4)
& (eqNum(N_4,32) | eqNum(N_4,9)))
clearChar(curfile) >
Let next character typed be a CTRL-character, such as formfeed, etc
<ctl-c:
putMsg("Input a control character:")
getChar(N_4)
if (geNum(31,N_4) | (geNum(N_4,64) & geNum(127,N_4))) {
and(N_4,N_4,31)
insertChar(curFile,N_4)
}
putMsg("") >
Count number of times the next command is successfully executed
<shftAlt-c:
equateNum(CYCLES,0)
putMsg("Input command to execute & count:")
if (getKey(MACRO_NUM)) {
while (runKey(MACRO_NUM)) incNum(CYCLES)
freeBuf(B_4)
insertRgn(B_4,sFile,"Times executed = ",all)
toWord(B_4,CYCLES)
putMsg(B_4)
} >
Delay the amount of time (tenths of seconds) stored using shftAlt-d
<alt-d: delay(DELAY_TIME) >
Delete cursor line, storing it in Undo buffer. (See keypad-0/7/9.)
<ctl-d: runKey(virtual-x)
>
Delete cursor line
<virtual-x:
if (!eqLoc(curFile,locB,atCursor)) runKey(520)
equateLoc(curFile,locB,atCursor)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
if (!eqLoc(curFile,locB,atCursor)) {
equateLoc(curFile,locA,atCursor)
insertRgn(UNDO_BUF,sFile,curFile,loc)
clearRgn(curFile,loc)
} else equateLoc(curFile,locA,atCursor)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
moveCursor(curFile,eChar)
equateLoc(curFile,locB,atCursor)
insertRgn(UNDO_BUF,eFile,curFile,loc)
equateLoc(UNDO_BUF,sPage,sFile)
clearRgn(curFile,loc) >
Set the delay variable to some value in tenths of seconds
<shftAlt-d:
putMsg("Input # tenths of seconds (used in delays)")
inputNum(DELAY_TIME) >
Change end-of-line character
<alt-e:
putMsg("Input new end-of-line value (usually 10 or 13):")
inputNum(N_4)
setEol(N_4)
refreshDisplay >
Change current document's end-of-line character
<ctl-e:
putMsg("Input file's current end-of-line value (usually 10 or 13):")
inputNum(N_4)
if (!gtNum(N_4,0)) returnFalse
putMsg("Input new end-of-line value (usually 10 or 13):")
inputNum(N_3)
if (!gtNum(N_3,0)) returnFalse
setEol(N_4)
moveCursor(curFile,sFile)
putMsg("Changing eol characters... Amiga-ESC=abort.")
if (is(curFile,N_4)) swapChar(curFile,N_3)
while (moveCursor(curFile,eLine))
if (is(curFile,N_4)) swapChar(curFile,N_3)
setEol(N_3)
vScroll(sFile)
putMsg("")
refreshDisplay >
Input the number of buffer to free
<alt-f:
putMsg("Input buffer # to free:")
if (inputNum(N_4)) freeBuf(buf[N_4]) >
Flip upper/lower case of char under cursor
<ctl-f:
if (is(curFile,alpha)) {
if (is(curFile,lowerCase)) toUpper(curFile)
else toLower(curFile)
}
moveCursor(curFile,eChar) >
Ask for new font name & size and change font
<shftAlt-f:
putMsg("Input font name (such as Topaz):")
freebuf(B_4)
if (inputString(B_4)) {
putMsg("Input font character height (such as 8):")
if (inputNum(N_4) & gtNum(N_4,5) & gtNum(33,N_4)) setFont(B_4,N_4)
else returnFalse
} else returnFalse
toggle(toTiny)
toggle(toTiny)
runkey(startup)
>
Input a new lines/page value
<alt-g:
putMsg("Enter new lines/page setting:")
inputNum(N_4)
if (gtNum(N_4,0)) {
setLocal(curFile,pageLines,N_4)
equateNum(pageLines,N_4)
} >
Uncolor the hilite region
<alt-h: equateLoc(curFile,sHilite,eHilite) refreshDisplay >
Erase hilite region. No Copy is made!
<ctl-h: clearRgn(curFile,hilite) vscroll(atCursor) >
Uncolor the invert region
<alt-i: equateLoc(curFile,sInvert,eInvert) refreshDisplay >
Erase the invert region. No Copy is made!
<ctl-i: clearRgn(curFile,invert) >
Scan index buffer, build an index. (See shftAlt-buttonDown/buttonUp.)
<shftAlt-i:
if (isEmpty(SWAP_BUF)) returnFalse
runKey(alt-g) .. Could elim. get lines-per-page setting to use
freeBuf(B_4)
putMsg("Working....") .. erase duplicate items in SWAP_BUF
label(10) .. get next index item
moveCursor(SWAP_BUF,sFile)
while (is(SWAP_BUF,whiteSpace)) clearChar(SWAP_BUF) .. clear any blank lines
if (is(SWAP_BUF,eFile)) goto label(11) .. done finding duplicates
equateLoc(SWAP_BUF,sInvert,atCursor) .. mark start
moveCursor(SWAP_BUF,downLine)
equateLoc(SWAP_BUF,eInvert,atCursor) .. mark end
freeBuf(B_0)
insertRgn(B_0,eFile,SWAP_BUF,invert) .. copy item to B_0
clearRgn(SWAP_BUF,invert) .. erase from SWAP_BUF
insertRgn(B_4,eFile,B_0,all) .. add it to B_4
moveCursor(SWAP_BUF,eFile) .. search bkwd for dups
setSearch(B_0)
while (search(SWAP_BUF,sInvert,eInvert,-1)) clearRgn(SWAP_BUF,invert).. del dup
goto label(10) .. get next item, unless SWAP_BUF empty now.
label(11)
freeBuf(SWAP_BUF) .. starting over
insertRgn(SWAP_BUF,eFile,B_4,all) .. store no-dup list in SWAP_BUF
freeBuf(B_4) .. erase old list in B_4
label(1) .. NOTE: should have used swapBuf instead
moveCursor(SWAP_BUF,sFile)
while (is(SWAP_BUF,whiteSpace)) clearChar(SWAP_BUF) .. clear lead white space
if (is(SWAP_BUF,eFile)) { .. SWAP_BUF empty, must be finished
swapBuf(B_4,SWAP_BUF) .. index was in B_4
freeBuf(B_4)
setFileName(SWAP_BUF,"Index")
equateLoc(SWAP_BUF,sPage,sFile)
equateLoc(SWAP_BUF,atCursor,sFile)
putMsg("Press ctl-w to see Index") .. finished
return
}
freeBuf(B_0)
insertRgn(B_0,sFile,SWAP_BUF,line) .. load search string with item.
clearRgn(SWAP_BUF,line) .. erase the item
putMsg(B_0) .. show the item
moveCursor(B_4,eFile) .. put item at end of index building
insertRgn(B_4,eFile,B_0,all)
insertRgn(B_4,eFile," ",all) .. space before page #s that go in
insertChar(B_4,eLine)
moveCursor(B_4,sChar)
equateNum(N_3,0) .. so know if need comma
moveCursor(curFile,sFile)
label(2)
setSearch(B_0)
while (search(curFile,sInvert,eInvert,1)) {
moveCursor(curFile,sChar)
if (is(curFile,alpha)) {
label(3) .. part of a bigger word so ignore
moveCursor(curFile,eInvert)
goto label(2) .. and resume search
}
if (is(curFile,digit)) goto label(3) .. part of bigger word, ignore
moveCursor(curFile,eInvert)
if (is(curFile,alpha)
| is(curFile,digit)) goto label(2).. part of bigger word, ignore
getPageRowCol(N_4,N_0,N_5) .. this uses display
moveCursor(curFile,eForm) .. don't search again on this page
if (!eqNum(N_3,0)) insertChar(B_4,",") .. put comma if not 1st #
toWord(B_4,N_4) .. install the page # after index item
equateNum(N_3,N_4) .. so will put in comma next time for sure
}
goto label(1) .. get next item from SWAP_BUF
>
Enter idle-timer value (tenths of sec) after which idle command executed
<shftAltCtl-i:
putMsg("Input idle time (tenths of a second)")
if (inputNum(N_4)) equateNum(idleTime,N_4)>
Join next line to cursor line
<ctl-j:
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
clearChar(curFile)
while (is(curFile,space) | is(curFile,9)) clearChar(curFile)
insertChar(curFile," ") >
Move the hilite to the left by one character (space or tab)
<alt-l:
moveCursor(curFile,sHilite)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
label(1)
if (is(curFile,space) | is(curFile,9)) clearChar(curFile)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
moveCursor(curFile,eChar) .. start of next line
if (gtLoc(curFile,eHilite,atCursor)) goto label(1) >
Convert the character under the cursor to lower case and move cursor fwd
<ctl-l:
toLower(curFile)
moveCursor(curFile,eChar) >
Set bottom margin
<lAmiga-l:
putMsg("Input bottom margin lines (0-200):")
if (inputNum(N_4)) equateNum(bottomMargin,N_4)
setLocal(curFile,bottomMargin,bottomMargin)>
Set command multiplier to use for next command
<ctl-m: putMsg("Input command multiplier:") inputNum(cmdMultiplier) >
Swap the mouse's button-Up operation with the next key-command pressed
<alt-m:
putMsg("Will swap mouse buttonUp with your next input:")
getKey(N_3)
if (swapKey(N_3,normal-buttonUp)) {
putMsg("Swapped - to undo, do it again")
return
}
putMsg("") >
Rename the document in the window
<alt-n:
putMsg("Input new filename:")
getFileName(FILE_NAME,curFile)
if (inputString(FILE_NAME))
setFileName(curFile,FILE_NAME) >
Input a text line number to go to
<ctl-n:
putMsg("Input line number:")
if (inputNum(N_4)) {
lineToLoc(curFile,atCursor,N_4)
vScroll(atCursor)
} >
Open the cursor line for typing
<ctl-o:
insertChar(curFile,eLine)
moveCursor(curFile,sChar) >
Switch to next "Favorite" file
<lAmiga-q: toggle(favorite) >
Move the hilite region to the right by one space
<alt-r:
moveCursor(curFile,sHilite)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (gtLoc(curFile,eHilite,atCursor)) {
insertChar(curFile,32)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
moveCursor(curFile,eChar)
} >
Terminate Learn Mode or run whatever is stored in learn-buffer. (See ctl-s.)
<ctl-r: runLearn >
Speak the hilite region
<alt-s:
if (gtLoc(curFile,eHilite,sHilite)) {
freeBuf(B_0)
insertRgn(B_0,eFile,curFile,hilite)
speak(B_0)
} >
Start/abort Learn Mode. (Use ctl-r to finish & to run it.)
<ctl-s:
if (!getFlag(curFile,learnMode)) putMsg("LEARN MODE ACTIVE!")
else putMsg("Learn Mode cancelled.")
flipFlag(curFile,learnMode) >
Line sort.
<shftAlt-s:
moveCursor(curFile,eFile)
if (!is(curFile,sLine)) insertChar(curFile,eLine)
sortLines(curFile,0)
>
Show key-help message on next key pressed. Copy key-help to RAM: on first
<ctl-t:
putMsg("Input a key, gadget, click etc to get Help msg")
getKey(N_4)
teachOne(N_4)>
Load UStar config
<virtual-u:
if (!loadConfig("UstarData!")) loadConfig("S:UstarData!") >
Convert char under cursor to upper case
<ctl-u:
toUpper(curFile)
moveCursor(curFile,eChar) >
Set left margin
<lAmiga-k:
putMsg("Input left margin column (0-200):")
if (inputNum(N_4)) equateNum(leftMargin,N_4)
setLocal(curFile,leftMargin,leftMargin)>
Set top margin
<lAmiga-u:
putMsg("Input top margin lines (0-200):")
if (inputNum(N_4)) equateNum(topMargin,N_4)
setLocal(curFile,topMargin,topMargin)>
Swap the current document in window with buffer 41
<ctl-w: swapBuf(curFile,SWAP_BUF) >
Swap current buffer to buffer 0 (the "home" buffer of Uedit)
<alt-w:
swapBuf(HOME_BUF,curFile)
editBuf(HOME_BUF) >
For programmers: Toggle number under cursor between hex/decimal
<ctl-x: hexDecimal(curFile) >
Execute an AmigaDOS command, but don't collect the results
<ctl-y:
putMsg("Enter AmigaDOS command")
freeBuf(DOS_CMD)
if (inputString(DOS_CMD)) execute(" ",DOS_CMD) >
Execute an AmigaDOS command and show the results
<ctl-z:
putMsg("Enter AmigaDOS command")
freeBuf(DOS_CMD)
freeBuf(DOS_RESULT)
if (!inputString(DOS_CMD) | !execute(DOS_RESULT,DOS_CMD)) returnFalse
if (!isEmpty(DOS_RESULT)) {
putMsg("Result of AmigaDOS command:")
downFlag(DOS_RESULT,changed)
editBuf(DOS_RESULT)
vscroll(sFile)
updateDisplay
return
}
putMsg("No reply from AmigaDOS.")
freeBuf(DOS_RESULT) >
Get listing. (Also sets directoryname used in ctl-buttonDown.)
<alt-z:
putMsg("Enter directory: ")
freeBuf(B_3)
if (inputString(B_3)) runKey(virtual-7)
freeBuf(B_4)
insertRgn(B_4,eFile,"Dir ",all)
insertRgn(B_4,eFile,DIR_NAMES,hilite)
if (!execute(DOS_RESULT,B_4)) returnFalse
moveCursor(DOS_RESULT,sFile)
insertChar(DOS_RESULT,eLine)
insertRgn(DOS_RESULT,sFile,DIR_NAMES,hilite)
newFile
swapBuf(DOS_RESULT,curFile)
freeBuf(DOS_RESULT)
vScroll(sFile)
putMsg("To load files, ctrl-click names with mouse.")
setFileName(curFile,B_4)
downFlag(curFile,changed) >
Change the current working directory
<altCtl-z:
putMsg("Change current directory to (may not work in Workbench):")
freeBuf(B_3)
if (inputString(B_3)) changeDir(B_3) >
Clear leading white space in cursor line
<alt-1:
equateLoc(curFile,locA,atCursor)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace) & !is(curFile,eLine) & !is(curFile,12))
clearChar(curFile)
equateLoc(curFile,atCursor,locA) >
Center text in the line. (Uses current line length.)
<alt-2:
runKey(alt-1) .. clear leading white space
if (is(curFile,blankLine)) returnFalse
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
locToCol(curFile,N_3,atCursor)
getLocal(curFile,N_4,lineLength)
if (gtNum(N_4,N_3)) {
moveCursor(curFile,sLine)
incNum(N_4)
sub(N_3,N_4,N_3)
div(N_3,N_3,2)
do (N_4,1,N_3) insertChar(curFile," ")
} >
Match indent of cursor line to previous line
<alt-4:
equateNum(N_4,0)
moveCursor(curFile,upLine)
if (!getFlag(curFile,autoIndent)) {
flipFlag(curFile,autoIndent)
equateNum(N_4,1)
}
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
clearChar(curFile)
typeChar(eLine)
if (eqNum(N_4,1)) flipFlag(curFile,autoIndent)
moveCursor(curFile,downLine) >
Right-align the cursor line from cursor rightward
<alt-5:
if (!is(curFile,whiteSpace)) moveCursor(curFile,sChar)
if (is(curFile,eLine)) return
while (is(curFile,whiteSpace) & !is(curFile,sLine)) {
clearChar(curFile)
moveCursor(curFile,sChar)
}
moveCursor(curFile,eChar)
equateLoc(curFile,locA,atCursor)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
locToCol(curFile,N_4,atCursor)
decNum(N_4)
getLocal(curFile,N_3,lineLength)
sub(N_4,N_3,N_4)
moveCursor(curFile,locA)
if (gtNum(N_4,0)) while (decNum(N_4)) insertChar(curFile," ") >
Show the value of a number variable
<alt-8:
putMsg("n-variable #: ")
inputNum(N_4)
freeBuf(B_4)
insertChar(B_4,"n")
toWord(B_4,N_4)
insertRgn(B_4,eFile," is ",all)
toWord(B_4,n[N_4])
putMsg(B_4) >
Save key command of next key pressed to RAM:pData
<rAmiga-8:
putMsg("Press key to save:")
if (getKey(N_4)) saveKeys("RAM:pData",N_4,0)
putMsg("")
>
Restore key command of next key pressed from RAM:pData
<rAmiga-9:
putMsg("Press key to restore:")
if (getKey(N_4)) loadKeys("RAM:pData",N_4,0)
putMsg("")
>
Set the value of a number variable
<alt-9:
putMsg("Set n-variable #:")
inputNum(N_4)
putMsg("To value:")
inputNum(n[N_4])>
Show the ASCII value of the character under the cursor
<ctl-/:
copyChar(curFile,N_4)
freeBuf(B_4)
toWord(B_4,N_4)
insertRgn(B_4,sFile,"Character value under cursor was ",all)
putMsg(B_4)
moveCursor(curFile,eChar) >
Show the current document size
<ctl-1:
fileSize(curFile,N_4)
freeBuf(B_4)
insertRgn(B_4,sFile,"File size in bytes: ",all)
toWord(B_4,N_4)
putMsg(B_4)>
This is a simple reformat cmd that doesn't refmt indented paragraphs.
.. <ctl-3: if (reformat) moveCursor(curFile,downLine) >
Reformat cursor paragraph, starting at cursor line
<ctl-3: .. move down, if blank line, to find par beginning.
while (is(curFile,blankLine)) {
moveCursor(curFile,downLine)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
if (is(curFile,eFile)) returnFalse
}
equateNum(N_6,0) .. a flag used below
equateLoc(curFile,locA,atCursor) .. store par beginning
label(2) .. get indent of 1st par line
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
locToCol(curFile,N_7,atCursor) .. get the 1st line's indent
if (eqNum(N_6,0)) { .. if doing FIRST line
equateNum(N_1,N_7) .. store indent of 1st par line
equateNum(N_6,1) .. set a flag so won't come back here
equateLoc(curFile,locB,atCursor) .. store 1st text location
moveCursor(curFile,downLine) .. move to 2nd line
if (is(curFile,blankLine)) { .. no second line
equateNum(N_7,1)
goto label(3)
}
goto label(2) .. go back and get indent of 2nd par line
}
label(3)
moveCursor(curFile,upLine) .. move back to 1st line
equateNum(N_0,N_7) .. store indent of 2nd line
if (eqNum(N_0,-1) | geNum(N_0,N_1)) { .. was no 2nd line or
reformat .. 2nd line inset, so do only 1st line
goto label(5) .. finished
} else { .. 2nd line has less or equal indent
sub(N_1,N_1,N_0) .. par indent = 1st indent minus 2nd
colToLoc(curFile,atCursor,N_0)
equateLoc(curFile,locA,atCursor)
freeBuf(B_4)
insertRgn(B_4,eFile,curFile,loc)
clearRgn(curFile,loc) .. wiping out extra 1st line indent
do (N_4,1,N_1) insertChar(curFile,"x") .. repl with x's
moveCursor(curFile,sWord) .. made a FAKE WORD
equateLoc(curFile,locA,atCursor) .. store its loc
reformat .. now paragrah has SAME indent
equateLoc(curFile,locB,atCursor) .. store end of par
moveCursor(curFile,locA) .. go back to fake word
while (is(curFile,"x")) clearChar(curFile)
insertRgn(curFile,atCursor,B_4,all) .. swap x's for indentation
equateLoc(curFile,atCursor,locB) .. goto end of par
label(5)
moveCursor(curFile,downLine) .. leave paragraph
}
>
Delete all trailing white-space in current document
<ctl-4:
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,sFile)
while (nothing) {
if (is(curFile,eFile))
{ equateLoc(curFile,atCursor,locA) return }
moveCursor(curFile,eLine)
moveCursor(curFile,sChar)
while (is(curFile,space) | is(curFile,9))
{ clearChar(curFile) moveCursor(curFile,sChar) }
moveCursor(curFile,eLine)
} >
Save a learn-sequence to disk, saving it under a Name
<ctl-5:
putMsg("Save learn seq under what Name?")
freeBuf(B_4)
if (inputString(B_4) & !saveLearn(B_4))
putMsg("Couldn't save") >
Load a learn-sequence stored on disk
<ctl-6:
putMsg("Load what learn seq Name?")
freeBuf(B_4)
if (inputString(B_4) & !loadLearn(B_4))
putMsg("Not found") >
Load and run learn-sequence stored on disk
<ctl-7:
putMsg("Load & run what learn seq Name?")
freeBuf(B_4)
if (inputString(B_4) & loadLearn(B_4)) runLearn
else putMsg("Not found") >
*** arithmetic commands ***
Set running arithmetic total to zero
<ctl-0: equateNum(SUM_TOTAL,0) >
Type the running arithmetic total into text at cursor
<ctl-\:
freeBuf(B_4)
div(N_2,SUM_TOTAL,100)
if (gtNum(0,SUM_TOTAL)) if (eqNum(N_2,0)) insertChar(B_4,"-")
toWord(B_4,N_2)
insertChar(B_4,".")
if (gtNum(0,SUM_TOTAL)) mul(N_2,SUM_TOTAL,-1)
else equateNum(N_2,SUM_TOTAL)
mod(N_2,N_2,100)
if (gtNum(10,N_2)) insertChar(B_4,"0")
toWord(B_4,N_2)
insertRgn(curFile,atCursor,B_4,all)
insertRgn(B_4,sFile,"Inserted total into text ",all)
putMsg(B_4) >
Add the next word (if a number) to arithmetic total & display total
<ctl-=:
moveCursor(curFile,eWord)
moveCursor(curFile,sWord)
if (!is(curFile,digit)) { moveCursor(curfile,eword) returnFalse }
toNumber(N_4,curFile)
moveCursor(curFile,eWord)
if (is(curFile,".")) {
moveCursor(curFile,eChar)
if (!is(curFile,digit)) goto label(1)
toNumber(N_3,curFile)
moveCursor(curFile,eChar)
if (!is(curFile,digit)) {
mul(N_3,N_3,10)
moveCursor(curFile,sChar)
}
moveCursor(curFile,eWord)
} else { label(1) equateNum(N_3,0) }
mul(N_4,N_4,100)
if (gtNum(0,N_4)) mul(N_2,N_3,-1)
else equateNum(N_2,N_3)
add(N_4,N_4,N_2)
add(SUM_TOTAL,SUM_TOTAL,N_4)
freeBuf(B_4)
div(N_2,SUM_TOTAL,100)
if (gtNum(0,SUM_TOTAL) & eqNum(N_2,0)) insertChar(B_4,"-")
toWord(B_4,N_2)
insertChar(B_4,".")
mod(N_2,SUM_TOTAL,100)
if (gtNum(0,SUM_TOTAL)) mul(N_2,-1,N_2)
if (gtNum(10,N_2)) insertChar(B_4,"0")
toWord(B_4,N_2)
insertRgn(B_4,sFile,"Running total is ",all)
putMsg(B_4) >
Subtract the next word (if a number) from arithmetic total & display total
<ctl--:
moveCursor(curFile,eWord)
moveCursor(curFile,sWord)
if (!is(curFile,digit)) { moveCursor(curfile,eword) returnFalse }
toNumber(N_4,curFile)
moveCursor(curFile,eWord)
if (is(curFile,".")) {
moveCursor(curFile,eChar)
if (!is(curFile,digit)) goto label(1)
toNumber(N_3,curFile)
moveCursor(curFile,eChar)
if (!is(curFile,digit)) {
mul(N_3,N_3,10)
moveCursor(curFile,sChar)
}
moveCursor(curFile,eWord)
} else {
label(1)
equateNum(N_3,0)
}
mul(N_4,N_4,100)
if (gtNum(0,N_4)) mul(N_2,N_3,-1)
else equateNum(N_2,N_3)
add(N_4,N_4,N_2)
sub(SUM_TOTAL,SUM_TOTAL,N_4)
freeBuf(B_4)
div(N_2,SUM_TOTAL,100)
if (gtNum(0,SUM_TOTAL) & eqNum(N_2,0)) insertChar(B_4,"-")
if (gtNum(0,SUM_TOTAL)) insertChar(B_4,"-")
toWord(B_4,N_2)
insertChar(B_4,".")
mod(N_2,SUM_TOTAL,100)
if (gtNum(0,N_2)) mul(N_2,N_2,-1)
if (gtNum(10,N_2)) insertChar(B_4,"0")
toWord(B_4,N_2)
insertRgn(B_4,sFile,"Running total is ",all)
putMsg(B_4) >
*** columnar data ***
Put up msg saying turn ON columnar if it is OFF.
<virtual-`:
if (!getFlag(curFile,columnar)) {
alertUser("Turn ON columnar display mode first. (See Columnar menu.)")
abort
} >
Copy and then clear the hilited columnar data
<shftCtl-1:
runKey(virtual-`)
freeBuf(COLUMNAR_BUF)
copyColData(COLUMNAR_BUF,sFile,curFile,hilite,1)
clearColData(curFile,hilite,0) >
Space-fill the hilited columnar data, overlaying the original text. No copy
<shftCtl-2:
runKey(virtual-`)
clearColData(curFile,hilite,1) >
Copy the hilited columnar data into a buffer
<shftCtl-3:
runKey(virtual-`)
if (geLoc(curFile,sHilite,eHilite)) returnFalse
freeBuf(COLUMNAR_BUF)
copyColData(COLUMNAR_BUF,sFile,curFile,hilite,1)>
Insert copied columnar data at the cursor
<shftCtl-4:
runKey(virtual-`)
copyColData(curFile,atCursor,COLUMNAR_BUF,all,1)>
Overlay copied columnar data onto existing text at the cursor
<shftCtl-5:
runKey(virtual-`)
copyColData(curFile,atCursor,COLUMNAR_BUF,all,0)>
Insert the columnar hilite region at the cursor. (No intermediate copy.)
<shftCtl-6:
runKey(virtual-`)
copyColData(curFile,atCursor,curFile,hilite,1)>
Overlay the columnar hilite region onto existing text at the cursor
<shftCtl-7:
runKey(virtual-`)
copyColData(curFile,atCursor,curFile,hilite,0)>
*** screen types (regular & interlace) ***
Switch among screen types
<shft-esc: flipFlag(curFile,lace) toggle(toTiny) toggle(toTiny) >
Switch to regular screen, 1 bitplane
<rAmiga-f1: setLocal(curfile, lace, 1) toggle(toTiny) toggle(toTiny) >
Switch to regular screen, 2 bitplanes
<rAmiga-f2: setLocal(curfile, lace, 0) toggle(toTiny) toggle(toTiny) >
Switch to interlace screen, 1 bitplane
<rAmiga-f3: setLocal(curfile, lace, 3) toggle(toTiny) toggle(toTiny) >
Switch to interlace screen, 2 bitplanes
<rAmiga-f4: setLocal(curfile, lace, 2) toggle(toTiny) toggle(toTiny) >
Assign a name to one of the 4 gadgets (1-4)
<ctl-esc:
putMsg("Enter gadget number (1-4):")
if (!inputNum(N_4) | gtNum(N_4,4) | gtNum(1,N_4)) returnFalse
putMsg("Enter gadget name (one Space to clear):")
freeBuf(B_4)
inputString(B_4)
if (!isEmpty(B_4)) {
gadgetName(N_4,B_4)
putMsg("")
} >
Uedit's About... msg
<shftAltCtl-a:
define(top_margin,20)
define(side_margin,10)
define(bottom_margin,10)
updatedisplay
while (inputKey(N_4)) nothing
... display on blank screen:
text("",1,0,0,-2)
putMsg(" About Uedit...")
sub(N_0,sWidth,10) .. max X for our display
sub(N_1,sHeight,10) .. max Y
do(N_2,20,N_1) {
draw(side_margin,top_margin,-1,2,0)
draw(N_0,N_2,-1,2,1)
}
do(N_2,10,N_0) { .. 20 is top_margin here
draw(10,top_margin,-1,2,0) .. side_margin, top_margin
draw(N_2,N_1,-1,2,1)
}
text("UEDIT",3,36,1,0)
text("(for AMIGA & PC)",4,30,-1,0)
text("(C) 1986-92 by Rick Stiles. All rights reserved.",6,13,3,0)
text("P.O. Box 666,",7,22,-1,0)
text(" Washington, IN 47501",-1,-1,-1,0)
text(" Uedit is a SHAREWARE programmable text editor for the ",9,10,1,0)
text(" technical user. See Uedit-Tutorial for general info ",10,10,-1,0)
text(" and instructions. ",11,10,-1,0)
text(" ",12,10,-1,0)
text(" Try Uedit and see how you like it. If you USE it, ",13,10,-1,0)
text(" become a REGISTERED USER by getting the full package. ",14,10,-1,0)
text(" See Uedit-Policy for price and registering info. ",15,10,-1,0)
getserialnum(N_4)
text("s/n ",17,33,3,0)
text(N_4,-1,-1,-1,0)
while (!inputKey(N_4)) nothing
sub(N_1,sWidth,50)
sub(N_2,sHeight,50) .. lower limit of our display
do(N_3,50,N_1) {
draw(50,50,-1,2,0) ..set position of the focus
draw(N_3,N_2,-1,2,1)
}
do(N_3,50,N_2) {
draw(50,50,-1,2,0)
draw(N_1,N_3,-1,2,1)
}
do(N_3,50,N_1) {
draw(50,50,-1,2,0) ..set position of the focus
draw(N_3,N_2,-1,2,1)
}
do(N_3,50,N_2) {
draw(50,50,-1,2,0)
draw(N_1,N_3,-1,2,1)
}
while (inputKey(N_4)) nothing
fullRefresh
putmsg("")
>
*****
Assign new Primitive Mode terminator Ctrl-key
<normal-esc:
putMsg("Enter new Primitive Mode terminator CTRL-key (pmESC)")
if (getChar(N_4) & gtNum(32,N_4)) equateNum(pmESC,N_4)
putMsg("") >
Save changed files during idle periods, if their idle-save flag is set
<idle:
getMaxFiles(N_2)
decNum(N_2)
do (N_4,0,N_2) if (!inputWaiting & getflag(buf[N_4],changed)
& getflag(buf[N_4],userLocalA)) saveFile(buf[N_4]) >
*** end of Config!M ***
<defines: >